FROM python:3.6
RUN mkdir /app  \
    && cd /app  \
    && git clone https://gitee.com/yezuoxian/check-duplicate.git  \
    && cd /app/check-duplicate  \
    && pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple \
    && cd /app/check-duplicate/bert-as-service  \
    && wget https://storage.googleapis.com/bert_models/2018_11_03/chinese_L-12_H-768_A-12.zip  \
    && unzip chinese_L-12_H-768_A-12.zip  \
    && rm chinese_L-12_H-768_A-12.zip
ENV FLASK_APP=app.py
ENV ZEROMQ_SOCK_TMP_DIR=/tmp/
EXPOSE 5000
WORKDIR /app/check-duplicate
CMD ["flask", "run", "--host=0.0.0.0"]
